package Demo;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

public class Demo19 {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newCachedThreadPool();
        executorService.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程执行的任务1");
            }
        });
        executorService.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程执行的任务2");
            }
        });
        executorService.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程执行的任务3");
            }
        });
    }
}
